package com.yugao.fintech.antelope.pay.common.manager;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yugao.fintech.antelope.base.exception.enums.GlobalErrorEnum;
import com.yugao.fintech.antelope.pay.common.mapper.MchInfoMapper;
import com.yugao.fintech.antelope.pay.model.entity.MchInfo;
import com.yugao.fintech.framework.assistant.utils.StringUtils;
import com.yugao.fintech.framework.assistant.utils.exception.BizException;
import org.springframework.stereotype.Component;

import java.util.Objects;


@Component
public class MchInfoManager extends ServiceImpl<MchInfoMapper, MchInfo> {
    public void checkExist(String mchNo) {
        if (StringUtils.isEmpty(mchNo) || Objects.isNull(this.getById(mchNo))) {
            throw new BizException(GlobalErrorEnum.OPERATION_FAIL_SELETE);
        }
    }
}
